/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Entidades;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Felipe
 */
@Entity
@Table(name = "consultas")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Consultas.findAll", query = "SELECT c FROM Consultas c"),
    @NamedQuery(name = "Consultas.findByConsultaId", query = "SELECT c FROM Consultas c WHERE c.consultaId = :consultaId"),
    @NamedQuery(name = "Consultas.findByDia", query = "SELECT c FROM Consultas c WHERE c.dia = :dia"),
    @NamedQuery(name = "Consultas.findByMes", query = "SELECT c FROM Consultas c WHERE c.mes = :mes"),
    @NamedQuery(name = "Consultas.findByAnno", query = "SELECT c FROM Consultas c WHERE c.anno = :anno"),
    @NamedQuery(name = "Consultas.findByDescripcion", query = "SELECT c FROM Consultas c WHERE c.descripcion = :descripcion")})
public class Consultas implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @NotNull
    @Column(name = "consulta_id")
    private Integer consultaId;
    @Basic(optional = false)
    @NotNull
    @Column(name = "dia")
    private int dia;
    @Basic(optional = false)
    @NotNull
    @Column(name = "mes")
    private int mes;
    @Basic(optional = false)
    @NotNull
    @Column(name = "anno")
    private int anno;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 200)
    @Column(name = "descripcion")
    private String descripcion;
    @JoinColumn(name = "id_procedimientos", referencedColumnName = "procedimientos_id")
    @ManyToOne(optional = false)
    private Procedimientos idProcedimientos;
    @JoinColumn(name = "id_vacas", referencedColumnName = "vacas_id")
    @ManyToOne(optional = false)
    private Vacas idVacas;

    public Consultas() {
    }

    public Consultas(Integer consultaId) {
        this.consultaId = consultaId;
    }

    public Consultas(Integer consultaId, int dia, int mes, int anno, String descripcion) {
        this.consultaId = consultaId;
        this.dia = dia;
        this.mes = mes;
        this.anno = anno;
        this.descripcion = descripcion;
    }

    public Integer getConsultaId() {
        return consultaId;
    }

    public void setConsultaId(Integer consultaId) {
        this.consultaId = consultaId;
    }

    public int getDia() {
        return dia;
    }

    public void setDia(int dia) {
        this.dia = dia;
    }

    public int getMes() {
        return mes;
    }

    public void setMes(int mes) {
        this.mes = mes;
    }

    public int getAnno() {
        return anno;
    }

    public void setAnno(int anno) {
        this.anno = anno;
    }

    public String getDescripcion() {
        return descripcion;
    }

    public void setDescripcion(String descripcion) {
        this.descripcion = descripcion;
    }

    public Procedimientos getIdProcedimientos() {
        return idProcedimientos;
    }

    public void setIdProcedimientos(Procedimientos idProcedimientos) {
        this.idProcedimientos = idProcedimientos;
    }

    public Vacas getIdVacas() {
        return idVacas;
    }

    public void setIdVacas(Vacas idVacas) {
        this.idVacas = idVacas;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (consultaId != null ? consultaId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Consultas)) {
            return false;
        }
        Consultas other = (Consultas) object;
        if ((this.consultaId == null && other.consultaId != null) || (this.consultaId != null && !this.consultaId.equals(other.consultaId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entidades.Consultas[ consultaId=" + consultaId + " ]";
    }
    
}
